﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Wp7nl.Converters
{
    /// <summary>
    /// Converts a string to all lowercase letters
    /// </summary>
    public class ToLowerValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return string.Empty;

            return value.ToString().ToLowerInvariant();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}